﻿using AttributeRouting.Web.Http;
//using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Water.Model;

namespace Water.RestService.Controllers
{
    public class PipeNetCheckController : ApiController
    {

        private PipeNetCheckQuery pncq;
        private PipeNetCheck pnc;

        [POST("GetPipeNetChecks")]
        public IList<PipeNetCheckQuery> PostGetPipeNetChecks(PipeNetCheckCon pncc)
        {
            pncq = new PipeNetCheckQuery();
            return pncq.GetPipeNetChecks(pncc);
        }
        /*
        [POST("GetPipeNetChecksCount")]
        public int PostGetPipeNetChecksCount(PipeNetCheck info)
        {
            var where = PipeNetCheckWhere(info);
            int count = rep.LoadCount(where);
            return count;
        }
        */

        [POST("AddPipeNetCheck")]
        public bool PostAddPipeNetCheck(PipeNetCheck info)
        {
            info.MRNO = BuilderMrno.GetMrnoFortbl("Tbt_PipeNetCheck");
            pnc = new PipeNetCheck();
            bool result = pnc.AddPipeNetCheck(info) > 0 ? true : false;
            return result;
        }

        /*
        [POST("EditPipeNetCheck")]
        public bool PostEditPipeNetCheck(PipeNetCheck info)
        {
            bool result = rep.Edit(info);
            return result;
        }

        [GET("DeletePipeNetCheck/{code}")]
        public bool GetDeletePipeNetCheck(string code)
        {
            bool result = rep.Delete(code);
            return result;
        }

        [GET("GetPipeNetCheck/{code}")]
        public PipeNetCheck GetPipeNetCheck(string code)
        {
            var result = rep.Get(code);
            return result;
        }
         */
    }
}
